<!DOCTYPE HTML>
<!--
	SARS-CoV-2 lineages
-->
<html>

{% include head.html %}


<body>

    <!-- Wrapper -->
    <div id="wrapper">

        <!-- Main -->
        <div id="main">
            <div class="inner">

                {% include header.html %}

                <!-- Content -->
                <section>
                	<header class="main">
                		<h2>{{ page.title }}</h2>
                	</header>

                  <div id="tableWrapper">
                      <h3><strong>Table 1</strong> | Lineage descriptions <br>  <input class="searchbar" type="text" id="myInput" onkeyup="myFunction('myInput','myTable')" placeholder="Search for lineage..." title="searchbar"></h3>
                      <br>
                  <table id="myTable">
                    <tr class="header">
                      <th style="width:10%;">Lineage</th>
                      <th style="width:30%;">Most common countries</th>
                      <th style="width:10%;">Earliest date</th>
                      <th style="width:10%;">Count</th>
                      <th style="width:30%;">Description</th>
                    </tr>
                      {% for child in page.children %}

                      {% assign row = site.data.lineage_data[child] %}
                    <tr>
                      {% if row["Lineage"] contains "*" %}
                      <td> {{ row["Lineage"] }} </td>
                      {% else %}
                      <td><a href="/lineages/lineage_{{ child }}.html">{{ row["Lineage"] }}</a> </td>
                      {% endif %}
                      <td>{{ row["Countries"] }}</td>
                      <td>{{ row["Earliest date"] }}</td>
                      <td>{{ row["Count"] }}</td>
                      <td>{{ row["Description"] }}</td>
                    </tr>
                      {% endfor %}
                    
                  </table>
                  </div>

                {{ content }}
                </section>
              </div>
          </div>
          <script>
            function myFunction(myInput, myTable) {
              var input, filter, table, tr, td, i, txtValue;
              input = document.getElementById(myInput);
              filter = input.value.toUpperCase();
              table = document.getElementById(myTable);
              tr = table.getElementsByTagName("tr");
              for (i = 0; i < tr.length; i++) {
                td = tr[i].getElementsByTagName("td")[0];
                if (td) {
                  txtValue = td.textContent || td.innerText;
                  if (txtValue.toUpperCase().indexOf(filter) > -1) {
                    tr[i].style.display = "";
                  } else {
                    tr[i].style.display = "none";
                  }
                }       
              }
            }
            </script>
          {% include sidebar.html %}

      </div>

      {% include footer.html %}

</body>

</html>